package com.add.petback.service.impl;

import com.add.petback.dao.PetMapper;
import com.add.petback.model.Pet;
import com.add.petback.service.PetService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Pet)表服务实现类
 *
 * @author makejava
 * @since 2020-03-10 15:54:09
 */
@Service("petService")
public class PetServiceImpl implements PetService {

    @Resource
    private PetMapper mapper;

    @Override
    public void insert(Pet object) {
        mapper.insertSelective(object);
    }

    @Override
    public void save(Pet object) {
        mapper.updateByPrimaryKeySelective(object);
    }

    @Override
    public List<Pet> getAll() {
        return mapper.list(new Pet());
    }

    @Override
    public Pet find(Pet object) {
        return mapper.find(object);
    }

    @Override
    public void delete(Pet object) {
        mapper.deleteByPrimaryKey(object.getPetpk());
    }

    @Override
    public List<Pet> getList(Pet object) {
        return mapper.list(object);
    }

    @Override
    public List<Pet> findTitle(Pet record)
    {
        return mapper.findTitle(record);
    }

}